<div id="contentbox">
 <span class="introtitle">ContentSwitch Extension (run only if installed!)</span><br/><span class="introdesc">Select the upload methods that you want to be active</span><br/><br/>
 <?php
  $configurazione = "SELECT other FROM spywall_config";
  $esegui = mysql_query($configurazione);
  $numero = mysql_fetch_assoc($esegui);
  if ($numero['other'] == 'go') {
   $aggiorna = "UPDATE spywall_config SET other = '1##1##1##1##1##1##1##1'"; $esegui = mysql_query($aggiorna); 
   $valorereg = $numero['other'];
   $valori = explode("##", $valorereg);
   $metphotoregolare = 1;
   $metphotoflash = 1;
   $metvideotube = 1;
   $metvideoflash = 1;
   $metodiattiviphoto= 1;
   $metodiattivivideo= 1;
   $photoaltri = 1;
   $videoaltri = 1;}
  else { 
   $valorereg = $numero['other'];
   $valori = explode("##", $valorereg);
   $metphotoregolare = $valori['0'];
   $metphotoflash = $valori['1'];
   $metvideotube = $valori['2'];
   $metvideoflash = $valori['3'];
   $metodiattiviphoto= $valori['4'];
   $metodiattivivideo= $valori['5'];
   $photoaltri = $valori['6'];
   $videoaltri = $valori['7'];    
  }
 ?>
 <div class="contentcon"><div class="medios1">Photo Regular method:</div><div class="medios2">
 <select name="fotoregolare" id="fotoregolare">
   <option onclick="controllo();" value="0"  <?php if($metphotoregolare=='0') { echo 'selected="selected"'; } ?>>NO</option>
   <option onclick="controllo();" value="1"  <?php if($metphotoregolare=='1') { echo 'selected="selected"'; } ?>>YES</option>
 </select></div></div>
 <div class="contentcon"><div class="medios1">Photo Flash method:</div><div class="medios2">
 <select name="fotoflash" id="fotoflash">
   <option onclick="controllo();" value="0"  <?php if($metphotoflash=='0') { echo 'selected="selected"'; } ?>>NO</option>
   <option onclick="controllo();" value="1"  <?php if($metphotoflash=='1') { echo 'selected="selected"'; } ?>>YES</option>
 </select></div></div>
 <div class="contentcon"><div class="medios1">Use other methods for Photos:</div><div class="medios2">
 <select name="othermetod">
  <option value="0"  <?php if($photoaltri=='0') { echo 'selected="selected"'; } ?>>NO</option>
  <option value="1"  <?php if($photoaltri=='1') { echo 'selected="selected"'; } ?>>YES</option>
 </select></div></div>
 <div class="contentcon"><div class="medios1">Video Youtube method:</div><div class="medios2">
 <select name="videotube" id="videotube">
   <option onclick="controllo2();" value="0"  <?php if($metvideotube=='0') { echo 'selected="selected"'; } ?>>NO</option>
   <option onclick="controllo2();" value="1"  <?php if($metvideotube=='1') { echo 'selected="selected"'; } ?>>YES</option>
 </select></div></div>
 <div class="contentcon"><div class="medios1">Video Flash method:</div><div class="medios2">
 <select name="videoflash" id="videoflash">
   <option onclick="controllo2();" value="0"  <?php if($metvideoflash=='0') { echo 'selected="selected"'; } ?>>NO</option>
   <option onclick="controllo2();" value="1"  <?php if($metvideoflash=='1') { echo 'selected="selected"'; } ?>>YES</option>
 </select></div></div>
  <div class="contentcon"><div class="medios1">Use other methods for Videos:</div><div class="medios2">
 <select name="othermetodvideo">
  <option value="0"  <?php if($videoaltri=='0') { echo 'selected="selected"'; } ?>>NO</option>
  <option value="1"  <?php if($videoaltri=='1') { echo 'selected="selected"'; } ?>>YES</option>
 </select></div></div>
 <div class="spazio"></div>
 <span class="introdesc">Sets the default upload method:</span><br /><br />
 Photo: 
  <select name="metphoto" id="metodofoto">
   <option onclick="controllo();" value="1"  <?php if($metodiattiviphoto=='1') { echo 'selected="selected"'; } ?>>Regular</option>
   <option onclick="controllo();" value="2"  <?php if($metodiattiviphoto=='2') { echo 'selected="selected"'; } ?>>Flash</option>
  </select>
   - Video: 
  <select name="metvideo" id="metodovideo">
   <option onclick="controllo2();" value="1"  <?php if($metodiattivivideo=='1') { echo 'selected="selected"'; } ?>>Youtube</option>
   <option onclick="controllo2();" value="2"  <?php if($metodiattivivideo=='2') { echo 'selected="selected"'; } ?>>Flash</option>
  </select>
 </div>

<script>
 function controllo() 
  {     
      var valore1 = $("#fotoregolare").val();
      var valore2 = $("#fotoflash").val();
      if (valore1 == '1' && valore2 == '1')  {$("#met_photo_view").fadeIn();}
      else if (valore1 == '0' && valore2 == '0')
	  {
	    alert ('Only one value can be OFF');
		$("#fotoregolare").val('1'); $("#fotoflash").val('1');
		$("#met_photo_view").fadeIn();
	  }
	  else if (valore1 == '1' && valore2 == '0')  {$("#metodofoto").val('1'); $("#met_photo_view").fadeOut();}
	  else if (valore1 == '0' && valore2 == '1')  {$("#metodofoto").val('2'); $("#met_photo_view").fadeOut();}     
  }
 
 function controllo2() 
 {      
      var valore1 = $("#videotube").val();
      var valore2 = $("#videoflash").val();
      if (valore1 == '1' && valore2 == '1')  {$("#met_video_view").fadeIn();}
      else if (valore1 == '0' && valore2 == '0') 
	  {
	   alert ('Only one value can be OFF');
	   $("#videotube").val('1'); $("#videoflash").val('1');$("#met_video_view").fadeIn();
	  }
      else if (valore1 == '1' && valore2 == '0')  {$("#metodovideo").val('1'); $("#met_video_view").fadeOut();}
      else if (valore1 == '0' && valore2 == '1')  {$("#metodovideo").val('2'); $("#met_video_view").fadeOut();}
  }
</script>